Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar styles #175

Closed
wants to merge 13 commits into from
Closed

Avatar styles #175

wants to merge 13 commits into from

Conversation

evgenoid
Copy link
Contributor

@evgenoid evgenoid commented May 13, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[x] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

Issue Number: GOOD-186

Does this PR introduce a breaking change?

[ ] Yes
[x] No
Screenshot 2024-05-17 at 11 31 02 Screenshot 2024-05-17 at 11 31 08 Screenshot 2024-05-17 at 11 31 14 Screenshot 2024-05-17 at 11 31 20 Screenshot 2024-05-17 at 11 31 36 Screenshot 2024-05-17 at 11 31 42 Screenshot 2024-05-17 at 11 31 49

@evgenoid evgenoid self-assigned this May 13, 2024
Copy link

netlify bot commented May 13, 2024

Deploy Preview for reablocks-storybook ready!

Name Link
🔨 Latest commit edbcbbb
🔍 Latest deploy log https://app.netlify.com/sites/reablocks-storybook/deploys/66471a4899a4f0000854ba98
😎 Deploy Preview https://deploy-preview-175--reablocks-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

/**
* Whether the avatar is able to interact.
*/
interactable?: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be inverse of disable. No need for new prop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some cases we don't neet user interaction with this component

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is that different from disabled?

@@ -24,7 +23,7 @@ export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* Style variant for the avatar.
*/
variant?: 'filled' | 'outline';
variant?: 'filled' | 'outline' | 'colored';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variant name could be better. Its not obvious whats different here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this like primary or maybe secondary or something? this isn't a common name we use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

primary or secondary it's more about color

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think still no. Its not obvious what this is and how its different from the others. Like filled could mean colored imo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had color property - now it is deprecated and moved to the variant. Also, user can pass colorOptions. IDK what you don't like.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like colored is the same things as filled, but with a diff background color. Is that right?

if a user wanted the avatar filled, but with a diff background color than their globally styled filled variant, it could be simpler for them to just pass an altered AvatarTheme to the component theme prop

Copy link
Contributor Author

@evgenoid evgenoid May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like colored is the same things as filled, but with a diff background color. Is that right?

Yes

The reason was to make component similar to figma design without breaking the functionality. Let me rethink it

tailwind.config.ts Outdated Show resolved Hide resolved
Copy link
Member

@amcdnl amcdnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to tweak variant name

@amcdnl amcdnl self-requested a review May 14, 2024 09:19
@evgenoid evgenoid changed the title Avatar component styling Avatar styles May 15, 2024
@evgenoid
Copy link
Contributor Author

I've moved it to the separate property
type?: 'colored' | 'monochrome';

@evgenoid evgenoid requested a review from ghsteff May 17, 2024 08:52
/**
* Style type for the avatar.
*/
type: 'colored' | 'monochrome';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be optional

Copy link
Member

@amcdnl amcdnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to fix type

@amcdnl amcdnl closed this Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants